--武欲精通
local wuyujingtong = fk.CreateSkill {
    name = "mcdh_wuyujingtong",
    tags ={Skill.Compulsory}
}

local U = require "packages/utility/utility"
local lib = require "packages/mcdh/lib"

wuyujingtong:addEffect(fk.EventPhaseStart,{
    can_trigger = function(self, event, target, player, data)
        return player:hasSkill(self) and target == player and player.phase == Player.Finish and player:isKongcheng()
    end,
    on_use = function(self, event, target, player, data)
        local room = player.room
        local choices = {"wuyujingtong1","wuyujingtong2"}
        if  player:hasSkill("mcdh_wujiewuzhong",true) then
            table.removeOne(choices,"wuyujingtong1" )
        end
        local choice = room:askForChoice(player, choices, self.name, nil, nil,{"wuyujingtong1","wuyujingtong2"})
        if choice == "wuyujingtong1" then
            room:handleAddLoseSkills(player, "mcdh_wujiewuzhong", nil, true, false)
        else
            player:drawCards(2,self.name)
        end
    end
})

Fk:loadTranslationTable {
    ["mcdh_wuyujingtong"] = "武欲精通",
    [":mcdh_wuyujingtong"] = "锁定技，结束阶段，若你没有手牌，则选择一项：1.获得〖无界无终〗；2.摸两张牌。",
    ["wuyujingtong1"] = "1.获得〖无界无终〗",
    ["wuyujingtong2"] = "2.摸两张牌。",
}

return wuyujingtong